package com.suncaper.tddmall.service;

import com.suncaper.tddmall.common.model.Goods;
import com.suncaper.tddmall.common.model.GoodsExample;
import com.suncaper.tddmall.mapper.CartMapper;
import com.suncaper.tddmall.mapper.GoodsMapper;
import com.suncaper.tddmall.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    UserMapper userMapper;
    @Autowired
    GoodsMapper goodsMapper;
    public Goods selectByPrimaryKey(String goodsId){
        Goods goods = goodsMapper.selectByPrimaryKey(goodsId);
        return goods;
    }

    @Override
    public List<Goods> searchBysubTitle(String subTitle) {
        return goodsMapper.selectByAll(subTitle);
    }

    public List<Goods> selectAll(){
       List<Goods> goodsList = goodsMapper.selectAll();
       return goodsList;
   }


}
